import {ResDto} from "../types/common";
import instance from "../axios.service";
import {BaseUrl} from "../common/constants";

export default {
    getList: (params: any): Promise<ResDto> => instance.get(`${BaseUrl}/v1/menu/info`, {params}),
    create: (data: any): Promise<ResDto> => instance.post(`${BaseUrl}/v1/menu/add`, data),
    edit: (params: {menuName: string, menuCode: string}): Promise<ResDto> => instance.put(`${BaseUrl}/v1/menu/deal?menuCode=${params.menuCode}&menuName=${params.menuName}`),
    del: (menuCode: string): Promise<ResDto> => instance.delete(`${BaseUrl}/v1/menu/delete/${menuCode}`),
}
